cmake_minimum_required(VERSION 3.10)
project(ProjectName)

find_package(OpenCV)
find_package(CUDA)
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -std=c++14 -w" )
include_directories(/usr/local/cuda-11.1/targets/x86_64-linux/include/)

cuda_add_library(main SHARED 
timer.cc
TrtEngine.cu
yolov5.cpp
json/json.cc
main.cc)

target_link_libraries(main 
${OpenCV_LIBS}
nvinfer
nvonnxparser
-L/usr/local/cuda/lib64/ -lcudart
)
include_directories(${OpenCV_INCLUDE_DIRS} ./)
add_executable(m main.cpp)
target_link_libraries(m main)
# target_link_libraries(m 

# )
